package com.spsecurity.controller;

import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @create 2022-03-2022/3/15-16:42
 */
@Controller
public class HelloController {

    @RequestMapping({"/index","/","/index.html"})
    public  String index(){
        return "index";
    }

    @RequestMapping("/toLogin")
    public String toLogin(){
        return  "views/login";
    }
    @RequestMapping("/level1/{id}")
    public String toLevel1(@PathVariable("id") int id){
        return "views/level1/"+id;
    }

    @RequestMapping("/level2/{id}")
    public String toLevel2(@PathVariable("id") int id){
        return "views/level12"+id;
    }

    @RequestMapping("/level3/{id}")
    public String toLevel3(@PathVariable("id") int id){
        return "views/level3/"+id;
    }
}
